package com.xikeda.controller;

import com.xikeda.model.CourierTable;
import com.xikeda.model.DeliveryTable;
import com.xikeda.model.UserTable;
import com.xikeda.service.imp.InquiryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author Xiao Linqing
 * @date 2020/6/6 8:59
 */
@Controller
/*@RequestMapping("/Find")*/
public class InquiryController {
    @Resource
    private InquiryService inquiryService;
    public InquiryService getInquiryService() {
        return inquiryService;
    }
    @Autowired
    public void setInquiryService(InquiryService inquiryService) {
        this.inquiryService = inquiryService;
    }

    /*@RequestMapping("/finduserid")
    @ResponseBody
    public String Inquiry3(HttpServletRequest request,HttpServletResponse  response)throws Exception{
        String telephone=request.getParameter("telephone");
        int id=inquiryService.findfindid(telephone);
        System.out.println(id);
        return "demo";
    }*/
   /* @RequestMapping("/findcommody")
    @ResponseBody
    public String Inquiry1 (HttpServletRequest request, HttpServletResponse response) throws Exception{
        String user_id = request.getParameter("user_id");
        System.out.println(user_id);
        //*int i=Integer.valueOf(user_id);*//*
        List<DeliveryTable> list=this.getInquiryService().FindID(user_id);
        if(list!=null&&list.size()>0){
            for(DeliveryTable li:list){
                System.out.println(li.getCommodity_name());
                System.out.println(li.getCourier_id());

            }
        }
        return "demo";
    }*/
   /* @RequestMapping("/findcourier")
    @ResponseBody
    public String Inquiry2 (HttpServletRequest request, HttpServletResponse response) throws Exception{
        String courier_id = request.getParameter("courier_id");
        System.out.println(courier_id);
        //*int i=Integer.valueOf(user_id);*//*
        List<CourierTable> list=this.getInquiryService().findcourier(courier_id);
        if(list!=null&&list.size()>0){
            for(CourierTable li:list){
                System.out.println(li.getCourier_true_name());
                System.out.println(li.getTelephone());
                System.out.println(li.getService_level());
            }
        }
        return "demo";
    }*/
    @RequestMapping("test4")
    public String InquiryExpress1(HttpServletRequest request, HttpServletResponse response){
        return "demo";
    }
}

